Update code block styling and syntax theme colors#5109
Merged
Conversation
|
@huntie is attempting to deploy a commit to the React Foundation Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for react-native ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
dc7a639 to
4f40608
Compare
Collaborator
Member
Author
|
@Simek I reckon this is enough contrast. Not keen on the visual clutter of shadows. I guess we could try an outline too, matching the admonitions (previewed below).
The main thing that matters I'd say is the text contrast (vs contrast with surrounding paragraphs). Edit: This also matches the homepage graphic more closely, actioning.
|
Modernise apperance of code blocks by updating font, tweaking sizing, and introducing light/dark variants (aligned with react.dev). **Changes** - Remove the custom Source Code Pro web font in favor of the default Docusaurus system monospace font stack. - Add separate light and dark Prism syntax themes aligned to the react.dev Sandpack color palette, replacing the previous single dark-only custom theme. - Reduce code block font size and increase line height. - Update code block title backgrounds to match their code block, with a keyline separator. Syntax colors source: https://github.com/reactjs/react.dev/blob/6ec61348646040795fdaa9de14a9bec603260f87/src/styles/sandpack.css#L38-L78
4f40608 to
db7561a
Compare
Simek
approved these changes
Jun 3, 2026
Simek
left a comment
Collaborator
There was a problem hiding this comment.
Agree, and border adds enough of separation. Thanks for the quick update! 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Modernise apperance of code blocks by updating font, tweaking sizing, and introducing light/dark variants (aligned with react.dev).
Changes
Syntax colors source: https://github.com/reactjs/react.dev/blob/6ec61348646040795fdaa9de14a9bec603260f87/src/styles/sandpack.css#L38-L78
Notes
The main motivation here is horizontal space efficiency, which I felt was poor with Source Code Pro.
Test plan
Before
After